package design.patterns.behavioral.chainofresponsibility;

/**
 * @author gjx
 * @version v1.0
 * @Description
 * @date 2019/4/10 17:16
 */

public abstract class ExamineAndApprove {
    abstract boolean examine();

     protected  ExamineAndApprove examineAndApprove;

    public void setExamineAndApprove(ExamineAndApprove examineAndApprove) {
        this.examineAndApprove = examineAndApprove;
    }

    public boolean judge(){//校验调度器
        boolean result = examine();//校验通过
        if(result){
            if(this.examineAndApprove != null){
                return this.examineAndApprove.judge();
            }
        }
        return result;
    }
}
